home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3376 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  42 lines

  1. Newsgroups: comp.lang.c
  2. Path: gail.ripco.com!mambuhl
  3. From: mambuhl@ripco.com (Martin Ambuhl)
  4. Subject: Re: pi algorithm...      
  5. X-Nntp-Posting-Host: golden.ripco.com
  6. Message-ID: <DLw89w.3ME@rci.ripco.com>
  7. Sender: usenet@rci.ripco.com (Net News Admin)
  8. Organization: Ripco Internet BBS Chicago
  9. Date: Sun, 28 Jan 1996 13:32:19 GMT
  10. X-Ident-Sender: mambuhl
  11.  
  12. kjpoglit@kjpoglit. (Karl Poglitsch) in <4e9a0c$foa@news.iconn.net>
  13. writes:
  14.  
  15. >What I'm looking for is some code that will ive me the value of pi out to the
  16. >nth decimal point.  I need at least 256 places, and it can be stored in a
  17. >character array.  Right now I'm using a pre coded array, and that just isn't
  18. >cutting it.  I have a few, but can't seem to get them working.
  19.  
  20. >Any help would be appreciated...
  21.  
  22. Try this TECO macro.  If you use some other editor, you should be able
  23. to translate this to your editor's macro support, unless your editor has
  24. less functionality than a 30-year old editor for much smaller and slower
  25. machines than you are likely to be using.
  26.  
  27. GZ0J\UNQN"E 40UN ' BUH BUV HK
  28. QN< J BUQ QN*10/3UI
  29. QI< \+2*10+(QQ*QI)UA B L K QI*2-1UJ QA/QJUQ
  30. QA-(QQ*QJ)-2\ 10@I// -1%I >
  31. QQ/10UT QH+QT+48UW QW-58"E 48UW %V ' QV"N QV^T ' QWUV QQ-(QT*10)UH >
  32. QV^T @^A/
  33. /HKEX$$
  34.  
  35. What?  You say TECO macros have nothing to do with C?  Damn, you're
  36. right!  But, then, neither does Karl's question.
  37.  
  38.                             
  39. --
  40. * Martin Ambuhl       net: mambuhl@ripco.com
  41. * Chicago, IL (USA)    
  42.